# -*- coding: utf-8 -*-
# @Time    : 2025/10/13
# @Author  : Syaoran
# @FileName: business_api.py
# @Desc    :

from app import app, request
from application.business_manage import BusinessService
from infrastructure.utils.http import responser

@app.route("/api/business_redbook_photo", endpoint="business_redbook_photo", methods=["POST"])
def business_redbook_photo():
    res_status, rjson = responser.post_param_check(
        request,
        [
            "keyword",
            "maxNotes"
        ],
    )
    if res_status == "success":
        return BusinessService.business_redbook_photo(
            keyword=rjson.get("keyword"),
            max_notes=rjson.get("maxNotes", 1),
        )
    return rjson

@app.route("/api/business_rokuhentai", endpoint="business_rokuhentai", methods=["POST"])
def business_rokuhentai():
    res_status, rjson = responser.post_param_check(
        request,
        [
            "keyword",
            "num"
        ],
    )
    if res_status == "success":
        return BusinessService.business_rokuhentai(
            keyword=rjson.get("keyword"),
            num=rjson.get("num", 1),
        )
    return rjson